Ft admin asset Type threshold notification #329
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[Finishes #167967311]
What does this PR do?
alerts admins in case the asset type threshold drops below the default threshold
Description of Task to be completed?
Current, we are assigning assets to users and departments without keeping track of the current remaining assets. this PR addresses this issue and if the remaining assets go below the default asset threshold, then admins will be notified via email
How should this be manually tested?
http://127.0.0.1:8000/api/v1/allocations
then assign an asset to a userAny background context you want to provide?
start by migrating the models. run the command python manage.py migrate to apply the necessary changes.
Make sure in ur
.env
file you set the variableDEFAULT_THRESHOLD
to a number for instance 20. then in theassettype
model edit the fields by giving them a threshold value that we will compare with the DEFAULT_THRESHOLD.set the email fields in your .env and give them values
MAIL_HOST = 'smtp.gmail.com'
EMAIL_HOST_USER = " "
EMAIL_HOST_PASSWORD = " "
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_SENDER=" "
after starting the server, make sure you open another terminal tab and run the command
python manage.py qcluster
to start theqCluster
What are the relevant pivotal tracker stories?
https://www.pivotaltracker.com/n/projects/2146417/stories/167967311